package fa.wangxing.leaf.Service.impl;

import fa.wangxing.leaf.Mapper.UserMapper;
import fa.wangxing.leaf.Service.UserService;
import fa.wangxing.leaf.pojo.User;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class UserServiceimpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public void register(User user) {
        userMapper.register(user);
    }

    @Override
    public User login(String userName, String password) {
        return userMapper.login(userName,password);
    }

    @Override
    public boolean isuser(String userName) {
        User user = userMapper.isuser(userName);
        if (user==null)
            return false;
        else
            return true;
    }
}
